package com.fallsvc.re.javasesets.reflectemunlambda.singleton;

public class Singleton1 {
    private volatile static Singleton1 uniqueInstance;

    private Singleton1() {
    }

    public static Singleton1 getInstance() {
        if (uniqueInstance == null) {
            synchronized (Singleton.class) {
                if (uniqueInstance == null) {//进入区域后，再检查一次，如果仍是null,才创建实例
                    uniqueInstance = new Singleton1();
                }
            }
        }
        return uniqueInstance;
    }
}